<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">
<title>积分规则</title>
<%@include file="../collect/meta.jsp"%>
<link rel="stylesheet" href="css/radius.css" type="text/css"></link>
<link rel="stylesheet" href="css/table.css" type="text/css"></link>
<link rel="stylesheet" href="css/btn-bottom.css" type="text/css"></link>
<script type="text/javascript" src="${ctx}/js/returnTop.js"></script>
</head>
<body lang="zh-cn">
	<div class="wrapper">
		<c:import url="/collect/top.jsp"></c:import>
		<div class="main-container" id="main-container">
			<div class="main-container-inner">
				<c:import url="/collect/left.jsp"></c:import>
				<div class="main-content">
					<div class="breadcrumbs" id="breadcrumbs">
						<ul class="breadcrumb">
							<li><i class="icon-home home-icon"></i>积分管理</li>
							<li><a href="integralrule!watchEnterpriseIntegralRule">积分规则</a></li>
							<li>积分等级</li>
						</ul>
						<!-- .breadcrumb -->
					</div>
					<div class="page-content">
						<div class="row">
							<div class="col-xs-12">
								<div class="tabbable">
									<ul class="nav nav-tabs" id="myTab">
										<li class="active"><a
											href="integralrule!watchEnterpriseIntegralRule">积分等级</a>
										</li>
										<li><a href="bGiveRule!entrygiveValue">注册时积分规则</a>
										</li>
										<li><a href="bGiveRule!watchBgiveRule">时间段规则</a>
										</li>
									</ul>
								</div>
								<br>
								<div class="alert alert-success">
									设定会员积分的等级规则，在会员消费时，系统会根据该规则自动更新会员等级。<br> 等级示例：<br>
									初级：0 ≤ 积分 ＜ 1000<br> 中级：1000 ≤ 积分 ＜ 2000<br> 高级：2000
									≤ 积分 ＜ 5000<br>
								</div>
								<a class="btn btn-primary radius" id="btn-bottom" style="margin-bottom:10px;"
									href="${ctx}/account/enterpriseintegralrule_add.jsp">新建</a>
								<table id="table_bug_report"
									class="table table-striped table-bordered table-hover">
									<tr>
										<th>积分名</th>
										<th>规则</th>
										<th>说明</th>
										<th>时间</th>
										<th>操作</th>
									</tr>
									<c:forEach items="${enterpriseIntegralRules}"
										var="integralRule" varStatus="status">
										<tr>
											<td>${integralRule.name}</td>
											<td>${integralRule.minValue}&nbsp;≤&nbsp;积分&nbsp;＜&nbsp;${integralRule.maxValue }</td>
											<td>${integralRule.descirption}</td>
											<td>${fn:substring(integralRule.createTime, 0, fn:indexOf(integralRule.createTime, '.'))}</td>
											<td>
												<a class="btn btn-xs btn-primary radius"
													href="integralrule!initModifyIntegralrule?enterpriseIntegralRule.id=${integralRule.id }">修改</a>
												<a id="del" class="btn btn-xs btn-primary radius"
													href="integralrule!delEnterpriseIntegralRule?enterpriseIntegralRule.id=${integralRule.id }">删除</a>
											</td>
										</tr>
									</c:forEach>
								</table>
							</div>
							<!-- /.col -->
						</div>
						<!-- /.row -->
					</div>
					<!-- /.page-content -->
				</div>
				<!-- /.main-content -->
			</div>
			<!-- /.main-container-inner -->
			<a href="#" id="btn-scroll-up"
				class="btn-scroll-up btn btn-sm btn-inverse"
				style="position:fixed;bottom:0;"> <i
				class="icon-double-angle-up icon-only bigger-110"></i> </a>
		</div>
		<!-- /.main-container -->
		<div class="push"></div>
	</div>
	<c:import url="/collect/down.jsp"></c:import>
	<!-- 弹出框（Modal） -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" 
   aria-labelledby="myModalLabel" aria-hidden="true">
   <div class="modal-dialog">
      <div class="modal-content radius">
         <div class="modal-header">
            <button type="button" class="close" 
               data-dismiss="modal" aria-hidden="true">
                  &times;
            </button>
            <h4 class="modal-title" id="myModalLabel">
               操作提示
            </h4>
         </div>
         <div class="modal-body">
                <p>确定删除此记录吗？</p>
         </div>
         <div class="modal-footer radius">
            <a id="confirm" class="btn btn-primary btn-sm radius">确定</a>
            <button type="button" class="btn btn-sm btn-default radius" 
               data-dismiss="modal">取消
            </button>
         </div>
      </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
	<script type="text/javascript">
		//防收回；$积分规则
		$(function() {
			$('.jifenguanli > ul').show();
			$('.jifenguanli > ul > li > a').eq(0).css("color", "red");
		});
		//提示框中确定按钮绑定删除事件
		$(function() {
			$("a#del").click(function() {
				var href = $(this).attr("href");
				$("#myModal").modal('show');
				$("a#confirm").attr("href", href);
				return false;
			});
		});
	</script>
</body>
</html>
